#include<iostream>
#include<vector>

using namespace std;

bool isKConsecutive(int n, int k) {
        if (k % 2 == 1) {
            return n % k == 0;
        } else {
            return n % k != 0 && 2 * n % k == 0;
        }
    }

int main(){
	int n;
	cin>>n;
	
	int result=0;
	for(int k = 1; k * (k + 1) <= 2*n; k++) {
        if (isKConsecutive(n, k)) {
            result++;
        }
    }

    cout<<result;
    return 0;
}
